module.exports = {
	//获取1个dom节点
	get(s) {
		return document.querySelector(s);
	},

	//获取所有符合条件的dom节点
	getAll(s) {
		return document.querySelectorAll(s);
	},

	//底部导航tabbar封装
	tabbar(filename) {
		let html = `
		<a href="index.html" class = "${
			filename === "index" ? "active" : ""
		}"> <i class="iconfont icon-index active"></i> 首页</a>
		<a href="sport_course.html" class = "${
			filename === "sport_course" ? "active" : ""
		}"> <i class="iconfont icon-ECG"></i> 运动</a>
		<a href="circle.html" class = "${
			filename === "circle" ? "active" : ""
		}"> <i class="iconfont icon-circle"></i>圈子</a>
		<a href="my.html" class = "${
			filename === "my" ? "active" : ""
		}"> <i class="iconfont icon-portrait"></i>我的</a>
		`;

		this.get(".tabbar").innerHTML = html;
	},

	//顶部导航navbar封装
	navbar(filename) {
		let html = `
		<a href="sport_run.html" class="${
			filename === "sport_run" ? "active" : ""
		}">跑步</a>
		<a href="sport_ride.html" class="${
			filename === "sport_ride" ? "active" : ""
		}">骑行</a>
		<a href="sport_course.html" class="${
			filename === "sport_course" ? "active" : ""
		}">课程训练</a>
		`;
		this.get(".navbar").innerHTML = html;
	},
};
